<!DOCTYPE html>
<html  lang="zh">
<head>
    <meta charset="utf-8" />

<meta name="generator" content="Hexo 3.9.0" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<title>Ayang818&#39;s blog</title>


    <meta name="description" content="杨丰畅的博客">
<meta name="keywords" content="Do something new!">
<meta property="og:type" content="website">
<meta property="og:title" content="Ayang818&#39;s blog">
<meta property="og:url" content="https://ayang818.gitee.io/blog/page/3/index.html">
<meta property="og:site_name" content="Ayang818&#39;s blog">
<meta property="og:description" content="杨丰畅的博客">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://ayang818.gitee.io/blog/images/og_image.png">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Ayang818&#39;s blog">
<meta name="twitter:description" content="杨丰畅的博客">
<meta name="twitter:image" content="https://ayang818.gitee.io/blog/images/og_image.png">







<link rel="icon" href="https://upload-serve.oss-cn-beijing.aliyuncs.com/avatar/avatar.jpg">


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.7.2/css/bulma.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/androidstudio.css">


    
    
<style>body>.footer,body>.navbar,body>.section{opacity:0}</style>

    
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css">

    
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css">

    
    
    
    
<link rel="stylesheet" href="/blog/css/back-to-top.css">

    
    
    
    
    
    
    
    <link rel="stylesheet" href="/blog/css/progressbar.css">
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
    
    
    


<link rel="stylesheet" href="/blog/css/style.css">
</head>
<body class="is-3-column">
    <nav class="navbar navbar-main">
    <div class="container">
        <div class="navbar-brand is-flex-center">
            <a class="navbar-item navbar-logo" href="/blog/">
            
                <img src="https://upload-serve.oss-cn-beijing.aliyuncs.com/avatar/avatar.jpg" alt="Ayang818&#39;s blog" height="28">
            
            </a>
        </div>
        <div class="navbar-menu">
            
            <div class="navbar-start">
                
                <a class="navbar-item"
                href="/blog/">主页</a>
                
                <a class="navbar-item"
                href="/blog/archives">归档</a>
                
                <a class="navbar-item"
                href="/blog/tags">分类</a>
                
                <a class="navbar-item"
                href="/blog/about">关于</a>
                
                <a class="navbar-item"
                href="https://github.com/ayang818">Github</a>
                
            </div>
            
            <div class="navbar-end">
                
                    
                    <a class="navbar-item" target="_blank" rel="noopener" title="Github" href="https://github.com/ayang818">
                        
                        <i class="fab fa-github"></i>
                        
                    </a>
                    
                
                
                
                <a class="navbar-item search" title="搜索" href="javascript:;">
                    <i class="fas fa-search"></i>
                </a>
                
            </div>
        </div>
    </div>
</nav>
    
    <section class="section">
        <div class="container">
            <div class="columns">
                <div class="column is-8-tablet is-8-desktop is-6-widescreen has-order-2 column-main">
    
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-09-28T04:40:39.000Z">2019-09-28</time>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    6 minutes 读完 (大约 892 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/blog/闭锁的几种实现/">Java的几种同步工具类(闭锁的实现)</a>
            
        </h1>
        <div class="content">
            <h2 id="什么是闭锁"><a href="#什么是闭锁" class="headerlink" title="什么是闭锁"></a>什么是闭锁</h2><p>闭锁是一种同步工具类，可以延迟线程的进度知道其进入终止状态。闭锁的作用就像是一扇门，在闭锁结束状态之前，这扇门就是关闭的，没有任何线程可以通过。当这扇门开启的时候，闭锁将不会改变状态，会一直维持开启的状态。闭锁可以用来确保某些活动直到其他活动都完成后才可以继续执行。</p>
<h2 id="CountDownLatch实现"><a href="#CountDownLatch实现" class="headerlink" title="CountDownLatch实现"></a>CountDownLatch实现</h2><p>CountDownLatch主要有两个重要的方法。</p>
<figure class="highlight"><table><tr><td class="code"><pre><span class="line"><span class="comment">// 次数减去1</span></span><br><span class="line">#countDown();</span><br><span class="line"><span class="comment">// 等待直到次数为0</span></span><br><span class="line">#await();</span><br></pre></td></tr></table></figure>

<p>下面的栗子体现了闭锁的等待作用</p>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">static</span> Long <span class="title">timeTasks</span><span class="params">(Integer taskNum)</span> <span class="keyword">throws</span> InterruptedException </span>&#123;</span><br><span class="line">    <span class="keyword">final</span> CountDownLatch startGate = <span class="keyword">new</span> CountDownLatch(<span class="number">1</span>);</span><br><span class="line">    <span class="keyword">final</span> CountDownLatch endGate = <span class="keyword">new</span> CountDownLatch(taskNum);</span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; taskNum; i++) &#123;</span><br><span class="line">        <span class="keyword">int</span> finalI = i;</span><br><span class="line">        <span class="keyword">new</span> Thread(() -&gt; &#123;</span><br><span class="line">            <span class="keyword">try</span> &#123;</span><br><span class="line">                System.out.println(Thread.currentThread().getName() +<span class="string">" is ready"</span>);</span><br><span class="line">                startGate.await();</span><br><span class="line">                <span class="keyword">try</span> &#123;</span><br><span class="line">                    Thread.sleep(<span class="number">2000</span>);</span><br><span class="line">                    System.out.println(Thread.currentThread().getName() + <span class="string">" thread is start"</span>);</span><br><span class="line">                &#125; <span class="keyword">finally</span> &#123;</span><br><span class="line">                    endGate.countDown();</span><br><span class="line">                &#125;</span><br><span class="line">            &#125; <span class="keyword">catch</span> (InterruptedException e) &#123;</span><br><span class="line">                e.printStackTrace();</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;).start();</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">long</span> start = System.currentTimeMillis();</span><br><span class="line">    <span class="comment">// 在主线程中一起释放</span></span><br><span class="line">    startGate.countDown();</span><br><span class="line">    endGate.await();</span><br><span class="line">    <span class="keyword">long</span> end = System.currentTimeMillis();</span><br><span class="line">    <span class="keyword">return</span> end - start;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
        </div>
        
        
        <div class="level is-mobile is-flex">
        <div class="level-start">
            
            <div class="level-item is-size-7 is-uppercase">
                <i class="fas fa-tags has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/blog/tags/Java/">Java</a>,&nbsp;<a class="has-link-grey -link" href="/blog/tags/并发编程/">并发编程</a>
            </div>
            
        </div>
        <div class="level-start">
            <div class="level-item">
            <a class="button is-size-7 is-light" href="/blog/闭锁的几种实现/#more">阅读更多</a>
            </div>
        </div>
        </div>
        
        
    </div>
</div>








    
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-09-15T12:15:10.000Z">2019-09-15</time>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    3 minutes 读完 (大约 398 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/blog/设计模式-5/">设计模式(5)——观察者模式</a>
            
        </h1>
        <div class="content">
            <h2 id="观察者模式是什么"><a href="#观察者模式是什么" class="headerlink" title="观察者模式是什么"></a>观察者模式是什么</h2><p>一句话，观察者模式（Observer Pattern）就是一种 “发布者-订阅者” 的模式。有时也被称为 “模型-视图”模式、“源-监听者”模式等。在这种模式中，由一个目标对象来管理所有依赖与它的观察者对象，并且当这个目标对象自身发生改变时，会主动向它的观察者们发出通知。</p>
<h2 id="类比举例"><a href="#类比举例" class="headerlink" title="类比举例"></a>类比举例</h2><p>比如你最近在追一个美剧《生活大爆炸》，假设著名在线视频网站某狐买下独家版权，在线更新与播放。于是你天天等啊等啊，等它的更新通知一来，你就去看那些最新的视频。<br><img src="https://upload-serve.oss-cn-beijing.aliyuncs.com/image/Observer.png"></img></p>
        </div>
        
        
        <div class="level is-mobile is-flex">
        <div class="level-start">
            
            <div class="level-item is-size-7 is-uppercase">
                <i class="fas fa-tags has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/blog/tags/Java/">Java</a>,&nbsp;<a class="has-link-grey -link" href="/blog/tags/设计模式/">设计模式</a>
            </div>
            
        </div>
        <div class="level-start">
            <div class="level-item">
            <a class="button is-size-7 is-light" href="/blog/设计模式-5/#more">阅读更多</a>
            </div>
        </div>
        </div>
        
        
    </div>
</div>








    
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-09-15T05:54:51.000Z">2019-09-15</time>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    5 minutes 读完 (大约 749 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/blog/设计模式-4/">设计模式(4)——装饰器模式</a>
            
        </h1>
        <div class="content">
            <h2 id="装饰器模式"><a href="#装饰器模式" class="headerlink" title="装饰器模式"></a>装饰器模式</h2><p>在接触Java之前，我接触过Python，在python中其实就有装饰器这个说法，装饰器模式的意思也差不多，就是动态的将新的职能附加到已有对象上，实现功能拓展。在阿里巴巴Java开发手册中其实有这么一段话<br><img src="https://upload-serve.oss-cn-beijing.aliyuncs.com/image/alipattern.png"></img><br>他告诉我们聚合和组合是要优先于继承的，若要使用继承，必须符合里氏代换原则。目的就是方便解耦。</p>
        </div>
        
        
        <div class="level is-mobile is-flex">
        <div class="level-start">
            
            <div class="level-item is-size-7 is-uppercase">
                <i class="fas fa-tags has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/blog/tags/Java/">Java</a>,&nbsp;<a class="has-link-grey -link" href="/blog/tags/设计模式/">设计模式</a>
            </div>
            
        </div>
        <div class="level-start">
            <div class="level-item">
            <a class="button is-size-7 is-light" href="/blog/设计模式-4/#more">阅读更多</a>
            </div>
        </div>
        </div>
        
        
    </div>
</div>








    
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-09-15T03:33:57.000Z">2019-09-15</time>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    3 minutes 读完 (大约 434 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/blog/设计模式-3/">设计模式(3)——适配器模式</a>
            
        </h1>
        <div class="content">
            <h2 id="什么场景需要使用适配器模式？"><a href="#什么场景需要使用适配器模式？" class="headerlink" title="什么场景需要使用适配器模式？"></a>什么场景需要使用适配器模式？</h2><p>顾名思义，适配器模式（Adapter Pattern）当然是用来适配的啦。当你想使用一个已有的类，但是这个类的接口跟你的又不一样，不能拿来直接用，这个时候你就需要一个适配器来帮你了。</p>
        </div>
        
        
        <div class="level is-mobile is-flex">
        <div class="level-start">
            
            <div class="level-item is-size-7 is-uppercase">
                <i class="fas fa-tags has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/blog/tags/Java/">Java</a>,&nbsp;<a class="has-link-grey -link" href="/blog/tags/设计模式/">设计模式</a>
            </div>
            
        </div>
        <div class="level-start">
            <div class="level-item">
            <a class="button is-size-7 is-light" href="/blog/设计模式-3/#more">阅读更多</a>
            </div>
        </div>
        </div>
        
        
    </div>
</div>








    
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-09-11T10:35:51.000Z">2019-09-11</time>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    6 minutes 读完 (大约 919 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/blog/设计模式-2/">设计模式(2)——工厂模式</a>
            
        </h1>
        <div class="content">
            <h2 id="为什么要有工厂模式"><a href="#为什么要有工厂模式" class="headerlink" title="为什么要有工厂模式"></a>为什么要有工厂模式</h2><p>工厂模式属于设计模式中创建型模式中的一种。 他的主要目的还是用来创建对象。只是工厂方法不会对调用者暴露创建的逻辑，只要你调用了某个工厂方法方法，我就根据参数返回你需要的对象。工厂模式分为三类，</p>
<ul>
<li>普通工厂模式</li>
<li>多个工厂模式</li>
<li>静态工厂模式</li>
<li>抽象工厂模式</li>
</ul>
<h2 id="举例"><a href="#举例" class="headerlink" title="举例"></a>举例</h2><p>例如我先在有两个类，一个是Man，一个是Women，他们都直接实现了Human这一接口</p>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line">Human.java</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">interface</span> <span class="title">Human</span> </span>&#123;</span><br><span class="line">    <span class="function"><span class="keyword">void</span> <span class="title">eat</span><span class="params">()</span></span>;</span><br><span class="line">    <span class="function"><span class="keyword">void</span> <span class="title">run</span><span class="params">()</span></span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
        </div>
        
        
        <div class="level is-mobile is-flex">
        <div class="level-start">
            
            <div class="level-item is-size-7 is-uppercase">
                <i class="fas fa-tags has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/blog/tags/Java/">Java</a>,&nbsp;<a class="has-link-grey -link" href="/blog/tags/设计模式/">设计模式</a>
            </div>
            
        </div>
        <div class="level-start">
            <div class="level-item">
            <a class="button is-size-7 is-light" href="/blog/设计模式-2/#more">阅读更多</a>
            </div>
        </div>
        </div>
        
        
    </div>
</div>








    
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-09-11T10:09:35.000Z">2019-09-11</time>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    10 minutes 读完 (大约 1428 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/blog/设计模式-1/">设计模式(1)</a>
            
        </h1>
        <div class="content">
            <h2 id="什么是设计模式"><a href="#什么是设计模式" class="headerlink" title="什么是设计模式"></a>什么是设计模式</h2><p>在软件工程中，设计模式是对软件设计中普遍存在的问题，所提出的解决方案。使用设计模式是为了可重用代码，让代码更有可读性，同时具有更好的可靠性。</p>
<h2 id="设计模式原则"><a href="#设计模式原则" class="headerlink" title="设计模式原则"></a>设计模式原则</h2><ol>
<li>开闭原则<br>开闭原则的意思是：<strong>对拓展开放，对修改封闭</strong>。在程序需要拓展时，不能去修改或影响已有的代码，实现一个热插拔的效果，达到了增强程序的拓展性的效果。想要达到这种效果，我们需要使用接口和抽象类。</li>
</ol>
        </div>
        
        
        <div class="level is-mobile is-flex">
        <div class="level-start">
            
            <div class="level-item is-size-7 is-uppercase">
                <i class="fas fa-tags has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/blog/tags/Java/">Java</a>,&nbsp;<a class="has-link-grey -link" href="/blog/tags/设计模式/">设计模式</a>
            </div>
            
        </div>
        <div class="level-start">
            <div class="level-item">
            <a class="button is-size-7 is-light" href="/blog/设计模式-1/#more">阅读更多</a>
            </div>
        </div>
        </div>
        
        
    </div>
</div>








    
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-09-09T12:51:29.000Z">2019-09-09</time>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    7 minutes 读完 (大约 1121 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/blog/无状态服务-有状态服务与CAP定理/">无状态服务,有状态服务与CAP定理</a>
            
        </h1>
        <div class="content">
            <h2 id="运维的一些职责"><a href="#运维的一些职责" class="headerlink" title="运维的一些职责"></a>运维的一些职责</h2><ul>
<li>安全</li>
<li>稳定</li>
<li>满负荷</li>
<li>长周期</li>
<li>优于拓展</li>
</ul>
<h2 id="无状态服务"><a href="#无状态服务" class="headerlink" title="无状态服务"></a>无状态服务</h2><p>无状态服务包括api服务，订单服务，购物车服务，图片服务，消息队列服务，负载均衡服务。无状态服务指的是，在整个系统运行过程中，在任意时刻，你将他销毁并重新创建一个全新的这种服务，他仍然可以完整的进行之前的工作。<br>这就意味着同一个无状态服务是可以分到不同的计算节点上的。比如说我们可以创建十个API服务，当外部服务请求这个API的时候，我们需要使用反向代理技术(Nginx)，将这些用户请求都代理给负载均衡，负载均衡通过负载均衡算法，例如源地址hash，cookie，或者轮转法来讲这些请求分配给一个随机的计算节点，这样这10个计算节点压力都不会太大！这其实就是经典的无状态服务负载均衡的部署方式，也是运维的满负荷职责体现！而随着服务开的越来越多，服务占用的计算资源也越来越多。那又如何实现优于拓展呢？我们可以在请求量大的时候，将我们的服务缩放到更多的服务，而业务量小的时候，就压缩回一个服务，在这个过程中，我们需要删除或增加大量的计算节点，这会非常麻烦，使用传统的物理机几乎是不可能的，而使用虚拟机事实上也是又非常浪费内存资源。其实最近几年诞生的一些新的技术，比如说容器，kubernetes，他们其实就有这种功能，他们可以根据业务量计算需求自动的缩放你的无状态服务数量。其实这个还涉及到健康监视的内容。这里不细写，因为我自己也不是很了解。</p>
        </div>
        
        
        <div class="level is-mobile is-flex">
        <div class="level-start">
            
            <div class="level-item is-size-7 is-uppercase">
                <i class="fas fa-tags has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/blog/tags/分布式理论/">分布式理论</a>
            </div>
            
        </div>
        <div class="level-start">
            <div class="level-item">
            <a class="button is-size-7 is-light" href="/blog/无状态服务-有状态服务与CAP定理/#more">阅读更多</a>
            </div>
        </div>
        </div>
        
        
    </div>
</div>








    
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-09-04T06:23:06.000Z">2019-09-04</time>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    6 minutes 读完 (大约 891 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/blog/并发容器/">并发容器</a>
            
        </h1>
        <div class="content">
            <h2 id="并发容器与同步容器"><a href="#并发容器与同步容器" class="headerlink" title="并发容器与同步容器"></a>并发容器与同步容器</h2><p>同步容器类包括Vector与HashTable，他们实现线程安全的方法是——将他们的状态封装起来，并会每一个公有方法都是用synchronize进行同步，使得每次只有一个线程可以访问容器的状态。但是同步容器同样存在着不安全因素，所以需要客户端加锁的行为，详情可以看<a href="https://ayang818.gitee.io/blog/2019/08/31/Vector%E5%92%8CArrayList%E7%9A%84%E7%BA%BF%E7%A8%8B%E5%AE%89%E5%85%A8%E6%80%A7/">我的上篇博客</a>。<br><br>而相比对于并发容器来说，同步容器将所有对容器状态的访问都串行化，以保证线程安全性，但是也严重严重降低了并发性。而并发容器是针对多个线程并发访问设计的，</p>
<ul>
<li>比如使用ConcurrentHashMap来代替HashMap，ConcurrentHashMap实现了ConcurrentMap这一接口，实现了一些computeIfAbset,getOrDefault,putIfAbsent这些方法</li>
<li>Java5中增加了两种容器类型，Queue和BlockingQueue，他的并发容器提供了这么些实现包括，ConcurrentLinkedQueue(传统的FIFO队列)，PriorityQueue(优先队列)。Queue一族不会阻塞，如果队列为空，那么获取元素的操作将返回空值。</li>
<li>BlockingQueue拓展了Queue，增加了可阻塞的插入和获取等操作，也就是阻塞队列。在生产者——消费者这种设计模式下，阻塞队列十分有用。</li>
</ul>
        </div>
        
        
        <div class="level is-mobile is-flex">
        <div class="level-start">
            
            <div class="level-item is-size-7 is-uppercase">
                <i class="fas fa-tags has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/blog/tags/Java/">Java</a>,&nbsp;<a class="has-link-grey -link" href="/blog/tags/并发编程/">并发编程</a>
            </div>
            
        </div>
        <div class="level-start">
            <div class="level-item">
            <a class="button is-size-7 is-light" href="/blog/并发容器/#more">阅读更多</a>
            </div>
        </div>
        </div>
        
        
    </div>
</div>








    
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-09-01T05:09:42.000Z">2019-09-01</time>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    5 minutes 读完 (大约 822 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/blog/从一个容器安全类引入单例模式/">从一个容器安全类引入单例模式</a>
            
        </h1>
        <div class="content">
            <h2 id="使用客户端加锁的Vector的复合操作"><a href="#使用客户端加锁的Vector的复合操作" class="headerlink" title="使用客户端加锁的Vector的复合操作"></a>使用客户端加锁的Vector的复合操作</h2>
        </div>
        
        
        <div class="level is-mobile is-flex">
        <div class="level-start">
            
            <div class="level-item is-size-7 is-uppercase">
                <i class="fas fa-tags has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/blog/tags/Java/">Java</a>,&nbsp;<a class="has-link-grey -link" href="/blog/tags/并发编程/">并发编程</a>,&nbsp;<a class="has-link-grey -link" href="/blog/tags/设计模式/">设计模式</a>
            </div>
            
        </div>
        <div class="level-start">
            <div class="level-item">
            <a class="button is-size-7 is-light" href="/blog/从一个容器安全类引入单例模式/#more">阅读更多</a>
            </div>
        </div>
        </div>
        
        
    </div>
</div>








    
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-08-31T11:43:08.000Z">2019-08-31</time>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    6 minutes 读完 (大约 945 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/blog/Vector和ArrayList的线程安全性/">Vector和ArrayList的线程安全性&amp;&amp;浅析ArrayList源码</a>
            
        </h1>
        <div class="content">
            <h2 id="一个例子出发"><a href="#一个例子出发" class="headerlink" title="一个例子出发"></a>一个例子出发</h2><p>下面的一个例子展示了ArrayList的非线程安全，以及ArrayList的错误检查机制</p>
        </div>
        
        
        <div class="level is-mobile is-flex">
        <div class="level-start">
            
            <div class="level-item is-size-7 is-uppercase">
                <i class="fas fa-tags has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/blog/tags/Java/">Java</a>,&nbsp;<a class="has-link-grey -link" href="/blog/tags/并发编程/">并发编程</a>
            </div>
            
        </div>
        <div class="level-start">
            <div class="level-item">
            <a class="button is-size-7 is-light" href="/blog/Vector和ArrayList的线程安全性/#more">阅读更多</a>
            </div>
        </div>
        </div>
        
        
    </div>
</div>









    
<div class="card card-transparent">
    <nav class="pagination is-centered" role="navigation" aria-label="pagination">
        <div class="pagination-previous">
            <a class="is-flex-grow has-text-black-ter" href="/blog/page/2/">上一页</a>
        </div>
        <div class="pagination-next">
            <a class="is-flex-grow has-text-black-ter" href="/blog/page/4/">下一页</a>
        </div>
        <ul class="pagination-list is-hidden-mobile">
            
            <li><a class="pagination-link has-text-black-ter" href="/blog/">1</a></li>
            
            <li><a class="pagination-link has-text-black-ter" href="/blog/page/2/">2</a></li>
            
            <li><a class="pagination-link is-current" href="/blog/page/3/">3</a></li>
            
            <li><a class="pagination-link has-text-black-ter" href="/blog/page/4/">4</a></li>
            
            <li><a class="pagination-link has-text-black-ter" href="/blog/page/5/">5</a></li>
            
        </ul>
    </nav>
</div>
</div>
                




<div class="column is-4-tablet is-4-desktop is-3-widescreen  has-order-1 column-left ">
    
        
<div class="card widget">
    <div class="card-content">
        <nav class="level">
            <div class="level-item has-text-centered" style="flex-shrink: 1">
                <div>
                    
                    <figure class="image is-128x128 has-mb-6">
                        <img class="" src="https://upload-serve.oss-cn-beijing.aliyuncs.com/avatar/avatar.jpg" alt="Ayang818 (杨丰畅)">
                    </figure>
                    
                    <p class="is-size-4 is-block">
                        Ayang818 (杨丰畅)
                    </p>
                    
                    
                    
                    <p class="is-size-6 is-flex is-flex-center has-text-grey">
                        <i class="fas fa-map-marker-alt has-mr-7"></i>
                        <span>中国，杭州</span>
                    </p>
                    
                </div>
            </div>
        </nav>
        <nav class="level is-mobile">
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        文章
                    </p>
                    <a href="/blog/archives">
                        <p class="title has-text-weight-normal">
                            46
                        </p>
                    </a>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        分类
                    </p>
                    <a href="/blog/categories">
                        <p class="title has-text-weight-normal">
                            0
                        </p>
                    </a>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        标签
                    </p>
                    <a href="/blog/tags">
                        <p class="title has-text-weight-normal">
                            31
                        </p>
                    </a>
                </div>
            </div>
        </nav>
        
        <div class="level">
            <a class="level-item button is-link is-rounded" href="https://github.com/ayang818" target="_blank" rel="noopener">
                关注我</a>
        </div>
        
        
        
        <div class="level is-mobile">
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="Github" href="https://github.com/ayang818">
                
                <i class="fab fa-github"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="RSS" href="/blog/">
                
                <i class="fas fa-rss"></i>
                
            </a>
            
        </div>
        
    </div>
</div>
    
        
    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            链接
        </h3>
        <ul class="menu-list">
        
            <li>
                <a class="level is-mobile" href="https://blog.csdn.net/syh0313" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">syh0313</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">blog.csdn.net</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://wzyxv1n.top/" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">wenzhuan</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">wzyxv1n.top</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://blog.csdn.net/weixin_43434223" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">旧博客</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">blog.csdn.net</span>
                    </span>
                </a>
            </li>
        
        </ul>
        </div>
    </div>
</div>

    
        <div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            标签云
        </h3>
        <a href="/blog/tags/DevOps/" style="font-size: 12.5px;">DevOps</a> <a href="/blog/tags/Git/" style="font-size: 10px;">Git</a> <a href="/blog/tags/IDEA/" style="font-size: 10px;">IDEA</a> <a href="/blog/tags/Java/" style="font-size: 20px;">Java</a> <a href="/blog/tags/JavaWeb/" style="font-size: 10px;">JavaWeb</a> <a href="/blog/tags/Kotlin/" style="font-size: 10px;">Kotlin</a> <a href="/blog/tags/Kugga/" style="font-size: 10px;">Kugga</a> <a href="/blog/tags/Vue/" style="font-size: 10px;">Vue</a> <a href="/blog/tags/express/" style="font-size: 10px;">express</a> <a href="/blog/tags/js/" style="font-size: 12.5px;">js</a> <a href="/blog/tags/maven/" style="font-size: 10px;">maven</a> <a href="/blog/tags/mybatis/" style="font-size: 10px;">mybatis</a> <a href="/blog/tags/mysql/" style="font-size: 10px;">mysql</a> <a href="/blog/tags/python/" style="font-size: 10px;">python</a> <a href="/blog/tags/分布式理论/" style="font-size: 12.5px;">分布式理论</a> <a href="/blog/tags/前后端分离/" style="font-size: 15px;">前后端分离</a> <a href="/blog/tags/反射/" style="font-size: 10px;">反射</a> <a href="/blog/tags/并发编程/" style="font-size: 17.5px;">并发编程</a> <a href="/blog/tags/微服务/" style="font-size: 10px;">微服务</a> <a href="/blog/tags/性能挑战赛/" style="font-size: 10px;">性能挑战赛</a> <a href="/blog/tags/日常技能/" style="font-size: 10px;">日常技能</a> <a href="/blog/tags/源码/" style="font-size: 10px;">源码</a> <a href="/blog/tags/算法/" style="font-size: 10px;">算法</a> <a href="/blog/tags/算法与数据结构/" style="font-size: 10px;">算法与数据结构</a> <a href="/blog/tags/老代码/" style="font-size: 10px;">老代码</a> <a href="/blog/tags/自嗨/" style="font-size: 10px;">自嗨</a> <a href="/blog/tags/设计模式/" style="font-size: 17.5px;">设计模式</a> <a href="/blog/tags/转载/" style="font-size: 10px;">转载</a> <a href="/blog/tags/部门教程/" style="font-size: 12.5px;">部门教程</a> <a href="/blog/tags/阶段总结/" style="font-size: 10px;">阶段总结</a> <a href="/blog/tags/随笔/" style="font-size: 15px;">随笔</a>
    </div>
</div>
    
    
        <div class="column-right-shadow is-hidden-widescreen ">
        
            <div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            最新文章
        </h3>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-05-02T05:10:49.000Z">2020-05-02</time></div>
                    <a href="/blog/第一届云原生编程挑战赛-分布式统计和过滤的链路追踪/" class="title has-link-black-ter is-size-6 has-text-weight-normal">第一届云原生编程挑战赛参赛小结</a>
                    <p class="is-size-7 is-uppercase">
                        
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-24T04:18:07.000Z">2020-04-24</time></div>
                    <a href="/blog/DevOps-使用Azure-pipeline为你的应用构建CI-CD流水线/" class="title has-link-black-ter is-size-6 has-text-weight-normal">[DevOps] 使用Azure pipeline + Github为你的应用构建CI/CD流水线</a>
                    <p class="is-size-7 is-uppercase">
                        
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-12T14:59:58.000Z">2020-04-12</time></div>
                    <a href="/blog/DevOps-如何写一个可快速构建镜像的Dockerfile脚本/" class="title has-link-black-ter is-size-6 has-text-weight-normal">[DevOps] 如何写一个可快速构建镜像的Dockerfile脚本</a>
                    <p class="is-size-7 is-uppercase">
                        
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-03-01T14:43:07.000Z">2020-03-01</time></div>
                    <a href="/blog/java-instrument/" class="title has-link-black-ter is-size-6 has-text-weight-normal">浅析Java强大的动态Instrumention能力</a>
                    <p class="is-size-7 is-uppercase">
                        
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-02-14T08:32:18.000Z">2020-02-14</time></div>
                    <a href="/blog/常用的一些算法板子-持续更新/" class="title has-link-black-ter is-size-6 has-text-weight-normal">常用的一些算法板子(持续更新)</a>
                    <p class="is-size-7 is-uppercase">
                        
                    </p>
                </div>
            </div>
        </article>
        
    </div>
</div>
        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            归档
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2020/05/">
                <span class="level-start">
                    <span class="level-item">May 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2020/04/">
                <span class="level-start">
                    <span class="level-item">April 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2020/03/">
                <span class="level-start">
                    <span class="level-item">March 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2020/02/">
                <span class="level-start">
                    <span class="level-item">February 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2020/01/">
                <span class="level-start">
                    <span class="level-item">January 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/12/">
                <span class="level-start">
                    <span class="level-item">December 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/11/">
                <span class="level-start">
                    <span class="level-item">November 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/10/">
                <span class="level-start">
                    <span class="level-item">October 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">8</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/09/">
                <span class="level-start">
                    <span class="level-item">September 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">9</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/08/">
                <span class="level-start">
                    <span class="level-item">August 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">7</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/07/">
                <span class="level-start">
                    <span class="level-item">July 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">7</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/06/">
                <span class="level-start">
                    <span class="level-item">June 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/03/">
                <span class="level-start">
                    <span class="level-item">March 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
        
        </div>
    
</div>

                
                




<div class="column is-4-tablet is-4-desktop is-3-widescreen is-hidden-touch is-hidden-desktop-only has-order-3 column-right ">
    
        <div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            最新文章
        </h3>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-05-02T05:10:49.000Z">2020-05-02</time></div>
                    <a href="/blog/第一届云原生编程挑战赛-分布式统计和过滤的链路追踪/" class="title has-link-black-ter is-size-6 has-text-weight-normal">第一届云原生编程挑战赛参赛小结</a>
                    <p class="is-size-7 is-uppercase">
                        
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-24T04:18:07.000Z">2020-04-24</time></div>
                    <a href="/blog/DevOps-使用Azure-pipeline为你的应用构建CI-CD流水线/" class="title has-link-black-ter is-size-6 has-text-weight-normal">[DevOps] 使用Azure pipeline + Github为你的应用构建CI/CD流水线</a>
                    <p class="is-size-7 is-uppercase">
                        
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-12T14:59:58.000Z">2020-04-12</time></div>
                    <a href="/blog/DevOps-如何写一个可快速构建镜像的Dockerfile脚本/" class="title has-link-black-ter is-size-6 has-text-weight-normal">[DevOps] 如何写一个可快速构建镜像的Dockerfile脚本</a>
                    <p class="is-size-7 is-uppercase">
                        
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-03-01T14:43:07.000Z">2020-03-01</time></div>
                    <a href="/blog/java-instrument/" class="title has-link-black-ter is-size-6 has-text-weight-normal">浅析Java强大的动态Instrumention能力</a>
                    <p class="is-size-7 is-uppercase">
                        
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-02-14T08:32:18.000Z">2020-02-14</time></div>
                    <a href="/blog/常用的一些算法板子-持续更新/" class="title has-link-black-ter is-size-6 has-text-weight-normal">常用的一些算法板子(持续更新)</a>
                    <p class="is-size-7 is-uppercase">
                        
                    </p>
                </div>
            </div>
        </article>
        
    </div>
</div>
    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            归档
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2020/05/">
                <span class="level-start">
                    <span class="level-item">May 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2020/04/">
                <span class="level-start">
                    <span class="level-item">April 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2020/03/">
                <span class="level-start">
                    <span class="level-item">March 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2020/02/">
                <span class="level-start">
                    <span class="level-item">February 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2020/01/">
                <span class="level-start">
                    <span class="level-item">January 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/12/">
                <span class="level-start">
                    <span class="level-item">December 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/11/">
                <span class="level-start">
                    <span class="level-item">November 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/10/">
                <span class="level-start">
                    <span class="level-item">October 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">8</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/09/">
                <span class="level-start">
                    <span class="level-item">September 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">9</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/08/">
                <span class="level-start">
                    <span class="level-item">August 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">7</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/07/">
                <span class="level-start">
                    <span class="level-item">July 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">7</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/06/">
                <span class="level-start">
                    <span class="level-item">June 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/blog/archives/2019/03/">
                <span class="level-start">
                    <span class="level-item">March 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
    
    
</div>

                
            </div>
        </div>
    </section>
    <footer class="footer">
    <div class="container">
        <div class="level">
            <div class="level-start has-text-centered-mobile">
                <a class="footer-logo is-block has-mb-6" href="/blog/">
                
                    <img src="https://upload-serve.oss-cn-beijing.aliyuncs.com/avatar/avatar.jpg" alt="Ayang818&#39;s blog" height="28">
                
                </a>
                <p class="is-size-7">
                &copy; 2020 ayang818&nbsp;
                Powered by <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> & <a
                        href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank" rel="noopener">Icarus</a>
                
                </p>
            </div>
            <div class="level-end">
            
                <div class="field has-addons is-flex-center-mobile has-mt-5-mobile is-flex-wrap is-flex-middle">
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="Creative Commons" href="https://creativecommons.org/">
                        
                        <i class="fab fa-creative-commons"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="Attribution 4.0 International" href="https://creativecommons.org/licenses/by/4.0/">
                        
                        <i class="fab fa-creative-commons-by"></i>
                        
                    </a>
                </p>
                
                </div>
            
            </div>
        </div>
    </div>
</footer>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/min/moment-with-locales.min.js"></script>
<script>moment.locale("zh-Hans");</script>


<script>
var IcarusThemeSettings = {
    site: {
        url: 'https://ayang818.gitee.io/blog',
        external_link: {"enable":true,"exclude":[]}
    },
    article: {
        highlight: {
            clipboard: true,
            fold: 'unfolded'
        }
    }
};
</script>


<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js" defer></script>





<script src="/blog/js/animation.js"></script>



<script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js" defer></script>
<script src="/blog/js/gallery.js" defer></script>



<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update
            my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js" defer></script>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        outdatedBrowser({
            bgColor: '#f25648',
            color: '#ffffff',
            lowerThan: 'flex'
        });
    });
</script>


<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
    MathJax.Hub.Config({
        'HTML-CSS': {
            matchFontHeight: false
        },
        SVG: {
            matchFontHeight: false
        },
        CommonHTML: {
            matchFontHeight: false
        },
        tex2jax: {
            inlineMath: [
                ['$','$'],
                ['\\(','\\)']
            ]
        }
    });
});
</script>


<a id="back-to-top" title="回到顶端" href="javascript:;">
    <i class="fas fa-chevron-up"></i>
</a>
<script src="/blog/js/back-to-top.js" defer></script>














<script src="/blog/js/main.js" defer></script>

    
    <div class="searchbox ins-search">
    <div class="searchbox-container ins-search-container">
        <div class="searchbox-input-wrapper">
            <input type="text" class="searchbox-input ins-search-input" placeholder="想要查找什么..." />
            <span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="searchbox-result-wrapper ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: '文章',
                PAGES: '页面',
                CATEGORIES: '分类',
                TAGS: '标签',
                UNTITLED: '(无标题)',
            },
            CONTENT_URL: '/blog/content.json',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script src="/blog/js/insight.js" defer></script>
<link rel="stylesheet" href="/blog/css/search.css">
<link rel="stylesheet" href="/blog/css/insight.css">
    
<script src="/blog/node_modules/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"node_modules/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/blog/node_modules/assets/shizuku.model.json"},"display":{"position":"right","width":150,"height":300},"mobile":{"show":true},"react":{"opacity":0.7},"log":false});</script></body>
</html>